package ordercode;

import java.util.Arrays;

public class BubbleOrder {
    public static void main(String[] args) {
        int[] arr = {6,5,34,12,23,67,13};
        for (int i = 0; i < arr.length-1; i++) {
            // 外面控制次数n-1次
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j] > arr[j+1]){
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }

        System.out.println(Arrays.toString(arr));
    }
}
